<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
    <input type="file" id="file">
    <button onclick="file()">上传</button>
    <script>
        function file(){
            let el=$('#file').get(0).files[0]
            let formdata=new FormData()
            formdata.append('hehe',el)
            console.log(el)
            $.ajax({
                url:'http://127.0.0.1:3000/file/upload',
                type:'POST',
                cache:false,
                data:formdata,
                processData:false,
                contentType:false,
                success:function(data){
                    console.log(data)
                }
            })
        }

    </script>
</body>
</html>